package boot;

/**
 * @program: springbootitem
 * @description: 状态码
 * @author: wdd
 * @create: 2019-08-26 14:03
 */
public enum ResultCodeEnum {

    SUCCESS(10200, "成功"),

    FAIL(10400,"失败"),

    SC_UNAUTHORIZED(401, "token不存在"),

    REQUEST_PARAM_ERROR(10400, "请求参数异常"),

    BUSINESS_ERROR(10500,"代码异常"),

    SERVER_ERROR(500, "服务器异常"),

    NOW_LOGIN_USER_DONT_DEL(20006,"超级管理员不能删除"),
    SUPER_USER_DONT_DEL(20005,"超级管理员不能删除"),
    USER_EXIST(20004,"用户名已被使用"),
    USER_IS_LOCK(20003,"用户已被锁定"),
    CAPTCHA_ERROR(20002,"验证码不正确"),

    USER_STATE_EDIT(10410,"身份被禁用"),
    NOT_LOGIN(10450,"请先登录"),
    USER_ROLE_EDIT(10420,"角色变更，重新登录"),

    USER_LOGIN_ERROR(20001, "用户不存在或密码错误");

    private Integer code;
    private String message;

    ResultCodeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer code() {
        return this.code;
    }

    public String message() {
        return this.message;
    }

    @Override
    public String toString() {
        return this.name();
    }
}